#coding=utf-8
from stscraper import get_price_since
from stutils import set_django_environ, data2csv
set_django_environ()
from stdj.stock.models import *

start_date = '2007-12-16'
for s in Share.objects.order_by('code'):
    print s
    data = get_price_since(s.code, start_date)
    if not data:
        continue
    
    fn = '/home/jay/temp/lastweek/%s.csv'%s.code
    data2csv(data, '' , fn)
    
    
